<template>
  <el-dialog
    class="findpass"
    title="修改密码"
    :visible.sync="show"
    width="600px"
    :before-close="close">
    <el-form label-width="80px" :model="formInline" class="demo-form-inline">

      <el-form-item label="新密码">
        <el-input v-model="formInline.password" placeholder="请输入新密码"></el-input>
      </el-form-item>
      
      <el-form-item>
        <el-button type="primary" @click="set">确认</el-button>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<script type="text/ecmascript-6">
export default {
  props: {
    show: Boolean
  },
  data() {
    return {
      formInline: {
        password: null
      }
    }

  },
  methods: {
    set() {
      let data = this.formInline
      this.$http.put('/student/user/modify/pw', data).then(res => {
        if(res.data.success) {
          this.$message.success('修改成功')
          this.close()
        }
      })
    },
    close() {
      this.$emit('close')
    }
  },
  components: {

  }
}
</script>

<style scoped lang="scss">
@import './index.scss';
</style>
